<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>

<spring:message code="trip.predefined_lbl" var="trip_predefined"/>
<spring:message code="trip.viewdetails_lbl" var="trip_viewdetails"/>
<spring:message code="trip.pricesfrom_lbl" var="trip_pricesfrom"/>
<spring:message code="trip.departure_lbl" var="trip_departure"/>
<spring:message code="trip.duration_lbl" var="trip_duration"/>
<spring:message code="trip.several_lbl" var="trip_several"/>
<spring:message code="trip.duration_lbl" var="trip_duration"/>
<spring:message code="trip.days_lbl" var="trip_days"/>
<spring:message code="trip.noresult_lbl" var="trip_noresult"/>
<spring:message code="trip.pricesnbooking_lbl" var="trip_pricesnbooking"/>
<spring:message code="currency_sign" var="currency_sign"/>

<c:if test="${not empty tripsviewmodel}">    
    <div class="col-md-11">
        <h2>${trip_predefined} ....</h2> <!-- Countries needed???? if not lable needs to be changed-->
    </div>
    <c:forEach var="tripviewmodel" items="${tripsviewmodel}">
        <c:set var="amount_days" value="${tripviewmodel.trip.amount_nights + 1} ${trip_days}"/>
        <div class="predefinedOverview col-md-11">
            <div class="col-md-3 col-sm-4">
                <img class="leftalign" style="margin-bottom: 10px; width:100%;" src="../img/trip/${tripviewmodel.trip.id}.jpg"/>
            </div>
            <div class="col-md-9 col-sm-8">
                <h3>${tripviewmodel.trip.title}</h3>
                <p>
                    <c:forEach var="accommodation" items="${tripviewmodel.accommodations}">
                        ${accommodation.country.name} / ${accommodation.city.name}
                    </c:forEach>
                </p>

                <p>${tripviewmodel.trip.description}</p>
                <p></p>
                <p>
                    <a href="details/${tripviewmodel.trip.id}">${trip_viewdetails}</a>
                </p>
            </div>
            <div class="col-md-2 rightalign">
                <div class="row rightalign">
                    <p style="font-size:14px">${trip_pricesfrom}  ${sign} ${tripviewmodel.trip.price}</p>

                    <p>${trip_departure}: ${trip_several}<br>
                        ${trip_duration}: ${amount_days}</p>
                </div>
                <div style="clear:both"></div>
                <a class="btn-link" href="details/${tripviewmodel.trip.id}">
                    <div class="submit">${trip_pricesnbooking}</div>
                </a>
            </div>
        </div>
    </c:forEach>
</c:if>
<c:if test="${empty tripsviewmodel}">
    <H3>${trip_noresult}</H3>
</c:if>